<template>
  <div class="goods">
   <!-- 面包屑组件 -->
    <el-breadcrumb separator="/">
      <!-- to: 路由跳转对象，同 vue-router 的 to -->
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品列表</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 按钮组件  : 添加角色按钮绑定事件，显示对话框 -->
    <el-button type="primary" plain @click="handleAddGoods">添加商品</el-button>
  </div>
</template>

<script>
export default {
  methods: {
    /* 添加商品  */
    handleAddGoods () {
      // 路由跳转
      this.$router.push({ name: 'add' })
    }
  }
}
</script>
